package com.demo.design.stractural.proxy.impl;

import com.demo.design.stractural.proxy.Subject;

public class ProxySubject implements Subject {
    private RealSubject realSubject = new RealSubject();

    @Override
    public void process() {
        preProcess();
        realSubject.process();
        afterProcess();
    }

    private void preProcess() {
        System.err.println("代理在代码块运行前做处理(这里是SB中介)");
    }

    private void afterProcess() {
        System.err.println("代理在代码块运行后做处理(这里是SB中介)");
    }
}
